package cn.edu.scau.cmi.linzhiyang.userInterface;


import cn.edu.scau.cmi.linzhiyang.abstractfactory.domainAbstractClass.InsuranceType;
import cn.edu.scau.cmi.linzhiyang.abstractfactory.factory.AbstractFactory;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.Label;

public class AbstractFactroyController {
	@FXML
	private Label lab_4;
	@FXML
	private ChoiceBox choicebox_1;
	@FXML
	private ChoiceBox choicebox_2;
	@FXML
	private Button btn_1;
	@FXML
	public void initialize() {
		ObservableList<String> list1 = FXCollections.observableArrayList("中国人寿保险", "平安保险");
		choicebox_1.setItems(list1);
		ObservableList<String> list2 = FXCollections.observableArrayList("驾驶员身体受伤", "汽车损坏", "人员伤亡", "多种事故");
		choicebox_2.setItems(list2);
	}
	public void evenButton() {
		String company = (String) choicebox_1.getValue();
		System.out.println(company);
		String type=(String) choicebox_2.getValue();
		System.out.println(type);
		String information="";
		information = AbstractFactory.getFactory(company).getInsuranceType(type).getInsurInfo();
		lab_4.setText(information);
	}

}
